#include "frame_tid_arr.h"


int tidArrInit(tidArr_t *pTidArr, int workerNum) {
	pTidArr->arr = (pthread_t*)calloc(workerNum, sizeof(pthread_t));
	pTidArr->workerNum = workerNum;
	return 0;
}

void tidArrFree(tidArr_t *pTidArr) {
	if (pTidArr == NULL) {
		return;  // 防止空指针解引用
	}

	if (pTidArr->arr != NULL) {
		free(pTidArr->arr);  // 释放线程ID数组
		pTidArr->arr = NULL; // 避免悬空指针
	}

	pTidArr->workerNum = 0;  // 可选：重置工作线程数量
}
